package com.skyvin.nreceipts.common.mapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.data.domain.Page;

import com.skyvin.nreceipts.common.document.ReceiptUpload;
import com.skyvin.nreceipts.common.dto.ReceiptUploadDTO;

public class ReceiptUploadMapper {
	public static ReceiptUploadDTO map(ReceiptUpload receiptUpload) {
		ReceiptUploadDTO receiptUploadDTO = new ReceiptUploadDTO();
		receiptUploadDTO.setId(receiptUpload.getId());
		receiptUploadDTO.setReceiptURL(receiptUpload.getReceiptURL());
		receiptUploadDTO.setUploadedDate(receiptUpload.getUploadedDate());
		return receiptUploadDTO;
	}
	public static List<ReceiptUploadDTO> map(Page<ReceiptUpload> receiptUploadDocuments) {
		List<ReceiptUploadDTO> receiptUploadDTOs = new ArrayList<ReceiptUploadDTO>();
		for (ReceiptUpload receiptUpload : receiptUploadDocuments) {
			receiptUploadDTOs.add(map(receiptUpload));
		}
		return receiptUploadDTOs;
	}
}
